﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Users_UserBalanceRunningAccountDetail : System.Web.UI.Page
{
    private string Code
    {
        get
        {
            return Request.QueryString["code"] != null ? Request.QueryString["code"].ToString() : "";
        }
    }

    protected void Page_PreInit(object sender, EventArgs e)
    {
        Page.Theme = BLL.Common.GetWSThemes();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = BasePage.WebTitle;
        if (HttpContext.Current.User.Identity.IsAuthenticated)
        {
            if (!IsPostBack)
            {
                BindMain();
                BindDetail();
            }
        }
        else
        {
            Response.Redirect("Login.aspx");
        }

    }

    private void BindMain()
    {
        DataSet dst = new BLL.BALANCEADJUST().GetById(this.Code);
        dlistMain.DataSource = dst;
        dlistMain.DataBind();
    }

    private void BindDetail()
    {

        dlistDetail.DataSource = new BLL.BADETAIL().GetDetailsByIdAndCustomerId(this.Code,BasePage.GetValue(0));
        dlistDetail.DataBind();
    }
}
